﻿Public Class frmGestioncertificado

    Private Sub frmGestioncertificado_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim dstRecord As New DataSet
        dstRecord.Tables.Add("vistaestadoproceso")
        mdlCRUD.loadRecord(dstRecord, "vistaestadoproceso", "vistaestadoproceso", "", Nothing)

        Me.cmbEstadocertificacion.DataSource = dstRecord.Tables("vistaestadoproceso")
        Me.cmbEstadocertificacion.DisplayMember = dstRecord.Tables("vistaestadoproceso").Columns(1).Caption.ToString
        Me.cmbEstadocertificacion.ValueMember = dstRecord.Tables("vistaestadoproceso").Columns(0).Caption.ToString
    End Sub

    Private Sub btnContinuar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnContinuar.Click
        Dim tipo As Integer = 0
        Dim arrParametro() As String = {"estadoproceso_id = '" & Me.cmbEstadocertificacion.SelectedValue & "'"}
        Dim strCondicion As String = "aspirante_id = " & mdlIntegracion.intIdaspirante
        mdlCRUD.updRecord("procesotramite", arrParametro, strCondicion)
        frmEvaluaciones.Close()
        Me.Close()
    End Sub

    Private Sub btnCancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelar.Click
        Me.Close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim dstRecord As New DataSet
        Dim array As Array
        dstRecord.Tables.Add("procesotramite")
        mdlCRUD.loadRecord(dstRecord, "procesotramite", "procesotramite", "aspirante_id ='" & mdlIntegracion.intIdaspirante & "'", Nothing)
        array = dstRecord.Tables("procesotramite").Rows(0).ItemArray.ToArray

        Dim arrParametro() As String = {"estadocertificacion_id = '5'"}
        Dim strCondicion As String = "procesotramite_id = " & array(0)
        mdlCRUD.updRecord("certificaciones", arrParametro, strCondicion)


    End Sub
End Class